#!/bin/sh

#作者：高伟
#my email: xiyou.gaowei@gmail.com
#version: G_IPv6P 0.1

version=1
#用法说明
usage()
{
        echo "Today's date is `date`"
        echo "The software's usage"
        echo "./G"$version"_IPv6G -fa|ff -a|d|o"
	echo "第一个参数是fa时是选择一个固定的IPv4前缀并且进行自动扩展"
	echo "第一个参数是ff时是从文件中读取IPv4的前缀"
	echo "第二个参数是a时是产生所有的ASN值"
	echo "第二个参数是d时是随机产生几个ASN的值"
	echo "第二个参数是o时是给定一个ASN的值"
}

if [ "$1" = "fa" ] || [ "$1" = "ff" ] || [ "$1" = "h" ]; then
	case "$1" in
        	fa) echo -n "固定的IPv4前缀, ";;
		ff) echo -n "从文件中读IPv4前缀的值, ";;
		* | h* | H*)    usage;;
	esac
else
	echo "第一个参数错误"
fi

if [ "$2" = "a" ] || [ "$2" = "d" ] || [ "$2" = "o" ]; then
	case "$2" in
		a) echo "产生所有的ASN值";;
		d) echo "是随机产生几个ASN的值";;
		o) echo "给定一个ASN的值";;
		*) usage;;
	esac
else
	echo "第二个参数错误"
fi

exit 0

